<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <article class="forecast">
        <h1>江西省赣州市寻乌县天气预报</h1>
        <article class="day-forecast">
            <h3>2022年1月16日</h3>
            <p>大雨</p>
        </article>
        <article class="day-forecast">
            <h3>2022年1月17日</h3>
            <p>小雨</p>
        </article>
        <article class="day-forecast">
            <h3>2022年1月18日</h3>
            <p>晴</p>
        </article>
    </article>
</body>
<style type="text/css">
    body {
        background-image: url("bg.jpg");
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
    }
    .forecast {
        position: relative;
        border-radius: 8px;
        box-shadow: 0 0 4px 0 gray;
        padding: 1rem;
        margin: 0 auto;
        width: 400px;
        font: 1rem "Arial", "Microsoft YaHei", "黑体", "宋体", sans-serif;
        backdrop-filter: blur(16px);
        background-color: rgba(255, 255, 255, 0.2);
    }

    .day-forecast {
        border-radius: 8px;
        margin: 0 0 1rem 0;
        padding: .2rem;
        background: right/4rem content-box border-box no-repeat url('rain.svg') rgba(255, 255, 255, 0.2);
    }

    .day-forecast:hover {
        background-color: rgba(255, 255, 255, 0.4);
    }
</style>
<script type="text/javascript">
    var boxs = document.getElementsByClassName('day-forecast');

    for (var i = 0; i < boxs.length; i++) {
        let j = i;
        boxs[i].onclick = function () {
            console.log(j);
        }
    }
</script>

</html>